<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<header class="main-header">
    <!-- Logo -->
    <a href="#" class="logo">
        <!-- mini logo for sidebar mini 50x50 pixels -->
        <span class="logo-mini">
            <%--<img src="/resource/dist/img/logo-50-50.png">--%>
        </span>
        <!-- logo for regular state and mobile devices -->
        <%--<span class="logo-lg"><img src="/resource/dist/img/logo-50-220.png"></span>--%>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
        <!-- Sidebar toggle button-->
        <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>
        <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
                <li class="dropdown user user-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <img src="/resource/dist/img/default_person.png" class="user-image" alt="User Image">
                        <span class="hidden-xs"><shiro:principal property="username"/></span>
                        <%--<span class="hidden-xs"></span>--%>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- User image -->
                        <li class="user-header">
                            <p>
                                <shiro:principal property="username"/>
                            </p>
                        </li>

                        <!-- Menu Footer-->
                        <li class="user-footer">
                            <div class="pull-left">
                                <a href="/user/center"  class="btn btn-default btn-flat">个人中心</a>
                            </div>
                            <div class="pull-right">
                                <a href="/user/password"  class="btn btn-default btn-flat">修改密码</a>
                            </div>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="javascript:void(0)" onclick="logout()"
                       data-toggle="control-sidebar"><i class="fa fa-sign-out"></i></a>
                </li>
            </ul>
        </div>
    </nav>
</header>
<script>

    function logout(){
        BootstrapDialog.confirm({
            title : '警告',
            message : "确认退出系统？",
            type : BootstrapDialog.TYPE_INFO,
            closable : true,
            draggable : true,
            btnCancelLabel : '取消',
            btnOKLabel : '确认',
            btnOKClass : 'btn-info',
            callback : function(result){
                if(result){
                    window.location.href="/logout";
                }
            }
        });
    }

</script>